<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.2/index.css" rel="stylesheet">
</head>

<body>
   
    <div id="app">
        {{num}}
        <my-first>
            <button @click="num++">点击</button>
        </my-first>
        <my-first>
            <a href="#">这是一个链接</a>
        </my-first>

        <my-first>1</my-first>

        <my-first>
            <template v-slot="{num}">
                {{num}}
            </template>

        </my-first>
    </div>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <!-- 一定要在引入vue3之后再引入element-plus  -->
    <script src="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.2/index.full.min.js"></script>
    <script>
        var app = Vue.createApp({
            data: function () {
                return {
                  
                }
            },
           
        });
        app.component('MyFirst', {
            template:`
                <div class='my-first'>
                        <slot :num="num">
                        这是一段默认文本    
                        </slot>    
                   
                </div>
            `,
            data(){
                return{
                    num:10
                }
            }
        });
        
        app.mount('#app');
    </script>
</body>

</html>